#include "titletreewidget.h"
#include <QVBoxLayout>
titleTreeWidget::titleTreeWidget(QWidget *parent) : QWidget(parent)
{

    QVBoxLayout *layout = new QVBoxLayout;
    layout->setMargin(0);
    layout->setSpacing(0);

    widgetTitleBar *title = new widgetTitleBar(this);
    layout->addWidget(title, 0, Qt::AlignTop);

    treeWidget = new QTreeWidget;
    layout->addWidget(treeWidget, 1);

    setLayout(layout);

    connect(title, &widgetTitleBar::closeParent, this,
            [=]()
            {
                if(treeWidget)
                    this->setHidden(true);
            });
    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
}

titleTreeWidget::~titleTreeWidget()
{

}
